/*  1:   */ package org.jetbrains.jps.model.library.impl;
/*  2:   */ 
/*  3:   */

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.JpsElement;
import org.jetbrains.jps.model.JpsElementCollection;
import org.jetbrains.jps.model.JpsElementTypeWithDefaultProperties;
import org.jetbrains.jps.model.library.JpsLibrary;
import org.jetbrains.jps.model.library.JpsLibraryCollection;
import org.jetbrains.jps.model.library.JpsLibraryType;
import org.jetbrains.jps.model.library.JpsTypedLibrary;

import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */ 
/* 14:   */ public class JpsLibraryCollectionImpl
/* 15:   */   implements JpsLibraryCollection
/* 16:   */ {
/* 17:   */   private final JpsElementCollection<JpsLibrary> a;
/* 18:   */   
/* 19:   */   public JpsLibraryCollectionImpl(JpsElementCollection<JpsLibrary> paramJpsElementCollection)
/* 20:   */   {
/* 21:37 */     this.a = paramJpsElementCollection;
/* 22:   */   }
/* 23:   */   
/* 24:   */   @NotNull
/* 25:   */   public <P extends JpsElement, LibraryType extends JpsLibraryType<P>,  extends JpsElementTypeWithDefaultProperties<P>> JpsLibrary addLibrary(@NotNull String paramString, @NotNull LibraryType paramLibraryType)
/* 26:   */   {
/* 27:44 */     if (paramString == null) {
/* 28:44 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 29:   */     }
/* 30:44 */     if (paramLibraryType == null) {
/* 31:44 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 32:   */     }
/* 33:44 */     JpsTypedLibrary tmp98_95 = addLibrary(paramString, paramLibraryType, (JpsElement)((JpsElementTypeWithDefaultProperties)paramLibraryType).createDefaultProperties());
/* 34:44 */     if (tmp98_95 == null) {
/* 35:44 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 36:   */     }
/* 37:44 */     return tmp98_95;
/* 38:   */   }
/* 39:   */   
/* 40:   */   @NotNull
/* 41:   */   public <P extends JpsElement> JpsTypedLibrary<P> addLibrary(@NotNull String paramString, @NotNull JpsLibraryType<P> paramJpsLibraryType, @NotNull P paramP)
/* 42:   */   {
/* 43:51 */     if (paramString == null) {
/* 44:51 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 45:   */     }
/* 46:51 */     if (paramJpsLibraryType == null) {
/* 47:51 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 48:   */     }
/* 49:51 */     if (paramP == null) {
/* 50:51 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 51:   */     }
/* 52:51 */     JpsTypedLibrary tmp142_139 = ((JpsTypedLibrary)this.a.addChild(new JpsLibraryImpl(paramString, paramJpsLibraryType, paramP)));
/* 53:51 */     if (tmp142_139 == null) {
/* 54:51 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 55:   */     }
/* 56:51 */     return tmp142_139;
/* 57:   */   }
/* 58:   */   
/* 59:   */   @NotNull
/* 60:   */   public List<JpsLibrary> getLibraries()
/* 61:   */   {
/* 62:57 */     List tmp9_4 = this.a.getElements();
/* 63:57 */     if (tmp9_4 == null) {
/* 64:57 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "getLibraries" }));
/* 65:   */     }
/* 66:57 */     return tmp9_4;
/* 67:   */   }
/* 68:   */   
/* 69:   */   @NotNull
/* 70:   */   public <P extends JpsElement> Iterable<JpsTypedLibrary<P>> getLibraries(@NotNull JpsLibraryType<P> paramJpsLibraryType)
/* 71:   */   {
/* 72:63 */     if (paramJpsLibraryType == null) {
/* 73:63 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "getLibraries" }));
/* 74:   */     }
/* 75:63 */     Iterable tmp50_45 = this.a.getElementsOfType(paramJpsLibraryType);
/* 76:63 */     if (tmp50_45 == null) {
/* 77:63 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "getLibraries" }));
/* 78:   */     }
/* 79:63 */     return tmp50_45;
/* 80:   */   }
/* 81:   */   
/* 82:   */   public void addLibrary(@NotNull JpsLibrary paramJpsLibrary)
/* 83:   */   {
/* 84:68 */     if (paramJpsLibrary == null) {
/* 85:68 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "addLibrary" }));
/* 86:   */     }
/* 87:68 */     this.a.addChild(paramJpsLibrary);
/* 88:   */   }
/* 89:   */   
/* 90:   */   public JpsLibrary findLibrary(@NotNull String paramString)
/* 91:   */   {
/* 92:73 */     if (paramString == null) {
/* 93:73 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "findLibrary" }));
/* 94:   */     }
/* 95:73 */     for (JpsLibrary localJpsLibrary : getLibraries()) {
/* 96:74 */       if (paramString.equals(localJpsLibrary.getName())) {
/* 97:75 */         return localJpsLibrary;
/* 98:   */       }
/* 99:   */     }
/* :0:78 */     return null;
/* :1:   */   }
/* :2:   */   
/* :3:   */   @Nullable
/* :4:   */   public <E extends JpsElement> JpsTypedLibrary<E> findLibrary(@NotNull String paramString, @NotNull JpsLibraryType<E> paramJpsLibraryType)
/* :5:   */   {
/* :6:84 */     if (paramString == null) {
/* :7:84 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "findLibrary" }));
/* :8:   */     }
/* :9:84 */     if (paramJpsLibraryType == null) {
/* ;0:84 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/library/impl/JpsLibraryCollectionImpl", "findLibrary" }));
/* ;1:   */     }
/* ;2:84 */     for (JpsTypedLibrary localJpsTypedLibrary : getLibraries(paramJpsLibraryType)) {
/* ;3:85 */       if (paramString.equals(localJpsTypedLibrary.getName())) {
/* ;4:86 */         return localJpsTypedLibrary;
/* ;5:   */       }
/* ;6:   */     }
/* ;7:89 */     return null;
/* ;8:   */   }
/* ;9:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.library.impl.JpsLibraryCollectionImpl

 * JD-Core Version:    0.7.0.1

 */